/**
 * 重载测试
 */

public class ReloadTest {
    public static void main(String[] args) {
        Maximum max = new Maximum();
        System.out.println(max.max(1, 2));
        System.out.println(max.max(1.0, 2.2));
        System.out.println(max.max(1.2, 2.2, 0.1));
        System.out.println(max.max(1, 2, 3, 4.0, 2, 10));
        System.out.println(max.max(new double[]{1, 2, 3, 4, 5, 10}));
        System.out.println(max.max("hello", 12, 3, 4));
    }
}

class Maximum {
    public int max(int i, int j) {
        return i > j ? i : j;
    }

    public double max(double i, double j) {
        return i > j ? i : j;
    }

    public double max(double i, double j, double k) {
        double result = i > j ? i : j;
        return result > k ? result : k;
    }

    public double max(double... nums) {
        double result = nums[0];
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] > result) {
                result = nums[i];
            }
        }
        return result;
    }

    public double max(String commit, double... nums) {
        System.out.println(commit);
        double result = nums[0];
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] > result) {
                result = nums[i];
            }
        }
        return result;
    }

}


